﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DAL;
using HomeStayWebCP.Models.BusinessObject;
using HomeStayWebCP.Utility;

namespace HomeStayWebCP.Models
{
    public class ImageModel
    {
        public List<ImageItem> GetImagesOfPost(int postID)
        {
            ImagesDataModel model = new ImagesDataModel();
            List<ImageItem> listResult = new List<ImageItem>();
            List<Store_Image_GetImagesOfPost_Result> l = model.GetImagesOfPost(postID);
            foreach (var i in l)
            {
                ImageItem item = new ImageItem();
                item.ImageID = i.ImageID;
                item.ImageName = Util.imagePath+ i.ImageName;
                //item.IsPosAvatar = i.IsPosAvatar;
                listResult.Add(item);
            }
            return listResult;
        }
    }
}